package List;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class CollectionTest {
    public static void main(String[] args) {
        Collection<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(12);
        list.add(13);
        list.add(14);
        list.remove(1);
        Iterator<Integer> iterator = list.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        Integer[] integers = list.toArray(new Integer[list.size()]);
        for (Integer integer : integers) {
            System.out.println(integer);
        }
        System.out.println(list.size());
        System.out.println(list.isEmpty());
        System.out.println(list.contains(14));
    }
}
